import sys
import os
import fire
import time

# Add the project root to the Python path
project_dir_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..'))
sys.path.append(project_dir_path)

from omics_bert_datasets_2_embeddings import EmbeddingReader

def main(db_path: str = os.path.join(project_dir_path, "embeddings_local/ukbiobank/v4.3-str_embeddings")):
    """
    Browse embeddings in a RocksDB database.

    :param db_path: Path to the RocksDB database file.
    """
    if not os.path.exists(db_path):
        print(f"Error: Database path does not exist: {db_path}")
        return


    with EmbeddingReader(db_path) as reader:
        print("--- Database Information ---")
        # reader.print_db_info()
        print("--------------------------")

        print("--- Embedding Information ---")
        # print(reader.get_embedding("0n0n0n0n0n3n"))
        print(reader.get_embedding("0n0n0n0n0n3n"))
        print(reader.get_embeddings_batch(["0n0n0n0n0n3n","1000028_22002_0_0.CEL","10000_0_0.CfdgEL"]))



if __name__ == '__main__':
    fire.Fire(main)